function grabaaudio(samplingRate,freq,N,nbits)	% Sampling rate, Muestras, resolucion de bits
	format long;
	fs = freq/samplingRate
	duration=[0:N*fs].';			% Recording duration 
	waveFile='prueba.wav';	% Wav file to be saved
	fprintf('Recording...');
	y=sin(2*pi*fs*duration);
	pause
	fprintf('Saving the audio file...');
	wavwrite(y, samplingRate, nbits, waveFile);
	[Y, FS, BITS] = wavread (waveFile); 
	h=stem(Y);
	print -deps -color audioexample.eps
end
